class Event < ActiveRecord::Base

    #Validation
  validates_presence_of :name
  validates_presence_of :date_ini
  validates_presence_of :date_fin
  validates_presence_of:positions
  validates_presence_of:maxamount
  validates_presence_of:category_id

  #Relations
  belongs_to :category
  has_many:competitors
  belongs_to :administrator
  has_many:gambles


  accepts_nested_attributes_for :competitors,  :allow_destroy => true
end